package beans;

import java.util.List;

import javax.faces.model.DataModel;

import daos.DAOprofessor;
import entidades.Professor;

public class MBprofessor {
	
	private Professor beanProfessor;
	private DAOprofessor daoProfessor;
	@SuppressWarnings("rawtypes")
	private DataModel listaProfessor;
	
	public MBprofessor (){
		beanProfessor = new Professor();
		daoProfessor = new DAOprofessor();	
	}

	public String prepararAdicionar(){
		beanProfessor = new Professor();
		return "adicionarprofessor";
	}
	
	public String adicionar(){
		daoProfessor.salvar(beanProfessor);
		return "professor";
	}
	
	public List<Professor> getListarMenu(){
		return daoProfessor.listar();
	}

	public Professor getBeanProfessor() {
		return beanProfessor;
	}

	public void setBeanProfessor(Professor beanProfessor) {
		this.beanProfessor = beanProfessor;
	}

	public DAOprofessor getDaoProfessor() {
		return daoProfessor;
	}

	public void setDaoProfessor(DAOprofessor daoProfessor) {
		this.daoProfessor = daoProfessor;
	}

	@SuppressWarnings("rawtypes")
	public DataModel getListaProfessor() {
		return listaProfessor;
	}

	@SuppressWarnings("rawtypes")
	public void setListaProfessor(DataModel listaProfessor) {
		this.listaProfessor = listaProfessor;
	}
	
}
